package com.solo.system.mapper;

import com.mybatisflex.core.update.UpdateChain;
import com.solo.system.api.entity.SysI18nType;
import com.solo.common.core.base.mapper.BasicMapper;
import org.apache.ibatis.annotations.Mapper;

import static com.solo.system.api.entity.table.SysI18nTypeTableDef.SysI18nTypeTable;

/**
 * 国际化语言类型 Mapper
 * @author 十一
 * @since 2024-10-23 15:10
 * 人生若只如初见，何事秋风悲画扇
 **/
@Mapper
public interface SysI18nTypeMapper extends BasicMapper<SysI18nType> {
    
    default boolean updateIsDefault(Long typeId) {
       return UpdateChain.of(this)
                .set(SysI18nTypeTable.IsDefault, false)
                .where(SysI18nTypeTable.TypeId.ne(typeId))
                .update();
    }
    
}
